home *** CD-ROM | disk | FTP | other *** search
/ Windows 6-Pak - Disc 5 / Windows 6-Pak (InfoMagic) (Disc 5) (1999).ISO / JAVA-Programming-Tools / jtk101c.exe / DISK2 / msgbox.ht_ / msgbox.ht
Encoding:
Text File  |  1998-08-24  |  6.8 KB  |  213 lines

  1. <html>
  2.   <head>
  3.     <title>Class MsgBox - Evans Java Toolkit</title>
  4.     <meta name="description" content="Evans Programming Java Toolkit - MsgBox">
  5.     <meta name="keywords" content="msgbox, java, message, box, modal, toolkit">
  6.     <meta name="DESIGN" content="Evans Programming, Hoffman Estates, IL">
  7.   </head>
  8.  
  9.   <body bgcolor="#FFFFFF" link="#FF0000" vlink="#800000" alink="#FF00FF">
  10.  
  11. <!--INCLUDESTART="JTCLSHDR.TXT"-->
  12.       <center>
  13.         <font face="Arial" size="5" color="0000FF">
  14.           <strong>Evans Programming Java Toolkit</strong><br>
  15.         </font>
  16.       </center>
  17.       
  18.       <center>
  19.         <font size="-2" face="Arial" color="FF0000">
  20.           <strong>
  21.             <a href="../jtkit.htm", target="_top">Java Toolkit Page</a> |
  22.             <a href="../softwr.htm", target="_top">Software</a> |
  23.             <a href="../index.html", target="_top">Home</a><br>
  24.           </strong>
  25.         </font>
  26.       </center>
  27. <!--INCLUDESTOP="JTCLSHDR.TXT"-->
  28. <!--INCLUDESTART="JTPGIDX.TXT"-->
  29.       <center>
  30.         <font size="-2" face="Arial" color="FF0000">
  31.           <strong>
  32.             <a href="#DESCRIPTION">Description</a> |
  33.             <a href="#EXAMPLES">Examples</a> |
  34.             <a href="#CONSTRUCTORS">Constructors</a> |
  35.             <a href="#METHODS">Methods</a>
  36.           </strong>
  37.         </font>
  38.       </center>
  39. <!--INCLUDESTOP="JTPGIDX.TXT"-->
  40. <!--INCLUDESTART="JTPGNAV.TXT"-->
  41.  
  42.     
  43.     <a href="install.htm">Previous</a> 
  44.     <a href="formtool.htm">Next</a> 
  45.     <a href="classidx.htm">Index</a><br>
  46.                                  
  47. <!--INCLUDESTOP="JTPGNAV.TXT"-->
  48.  
  49.     <hr>
  50.     <h1>Class MsgBox</h1>
  51.  
  52.     <pre>
  53. public class evans.toolkit.<strong>MsgBox</strong> extends Frame implements Runnable
  54. {
  55.     // Constructors
  56.     public <strong>MsgBox</strong>(Frame parent, String title,
  57.         boolean modal, String msg, URL urlImage);
  58.     public <strong>MsgBox</strong>(Frame parent, String title,
  59.         boolean modal, String msg);
  60.  
  61.     // Methods
  62.     /* This class has no methods */
  63. }   </pre>
  64.  
  65.     <hr>
  66.     <a name="DESCRIPTION"><img src="descript.gif" width=220 height=60 alt="Description"></a>
  67.     <p>
  68.       This class pops-up a framed message with an OK button, title and
  69.       an image (optional). MsgBox closes when the OK button is pressed.
  70.       The message is a wrap-around. MsgBox height automatically resizes
  71.       itself to a max of 24 lines by 1/2 screen width.
  72.     </p>
  73.     <center><img src="msgbox.gif" width="265" height="140"></center>
  74.     <p>
  75.       Inserting the ASCII character 10 into the message adds carriage
  76.       returns if desired.
  77.     </p>
  78.  
  79.     <hr>
  80.     <a name="EXAMPLES"><img src="example.gif" width=220 height=60 alt="Example"></a>
  81.  
  82.     <dl>
  83.       <dt><h3>Modal Message With Carriage Returns Inserted and No Image</h3>
  84.     </dl>
  85.  
  86.     <pre>
  87.       import java.applet.*;
  88.       import evans.toolkit.*;
  89.  
  90.       public void displayMessage()
  91.       {
  92.           // Create carriage return - svENTER
  93.           final Character ocChar = new Character((char)10);
  94.           final String svENTER = new String(ocChar.toString());
  95.  
  96.           // Create message with Carriage Returns Inserted
  97.           String svMsg = "Line 1" + svENTER + "Line 2" + svENTER + svENTER + "Line 4";
  98.  
  99.           // Display message
  100.           String svTitle = new String("Evans Java Toolkit Message");
  101.           oMsgBox = new MsgBox(this, svTitle, true, svMsg);
  102.       }</pre>
  103.  
  104.     <dl>
  105.       <dt><h3>Non-Modal Message with Image</h3>
  106.     </dl>
  107.  
  108.     <pre>
  109.       import java.applet.*;
  110.       import java.net.*;
  111.       import evans.toolkit.*;
  112.  
  113.       public void init()
  114.       {
  115.           URL url = null;
  116.  
  117.           try
  118.           {
  119.               // Image in same dir as HTML doc
  120.               url = new URL(getDocumentBase(), "exclam.gif");
  121.  
  122.               // Display modal message
  123.               String svMsg = new String("Where do you want to be tomorrow?");
  124.               String svTitle = new String("Evans Java Toolkit Message");
  125.               oMsgBox = new MsgBox(this, svTitle, false, svMsg, url);
  126.           }
  127.           catch (MalformedURLException me)
  128.           {
  129.           }
  130.       }</pre>
  131.  
  132.     <hr>
  133.     <a name="CONSTRUCTORS"><img src="constrct.gif" width=220 height=60 alt="Constructors"></a>
  134.  
  135.     <dl>
  136.       <dt><h3>MsgBox</h3>
  137.       <dl>
  138.         <dt><code>public <strong>MsgBox</strong>(Frame parent, String title,<br>
  139.         <dd>boolean modal, String msg, URL urlImage);</code>
  140.       </dl>
  141.       <dd><p>Creates a message box with an image.</p>
  142.     </dl>
  143.  
  144.     <dl>
  145.       <dt><h3>MsgBox</h3>
  146.       <dl>
  147.         <dt><code>public <strong>MsgBox</strong>(Frame parent, String title,
  148.         <dd>boolean modal, String msg);</code>
  149.       </dl>
  150.       <dd><p>Creates a message box without an image.</p>
  151.  
  152.       <dl>
  153.         <dt><h4>Parameters:</h4>
  154.         <dd><strong>parent</strong> - Frame - The parent object.
  155.         <dd><strong>title</strong> - String - The message title.
  156.         <dd><strong>modal</strong> - Boolean - True creates a modal MsgBox, false creates a modeless MsgBox.
  157.         <dd><strong>msg</strong> - String - The message to display.
  158.         <dd><strong>urlImage</strong> - URL - Specifies the image to display.
  159.       </dl>
  160.     </dl>
  161.  
  162.     <hr>
  163.     <a name="METHODS"><img src="methods.gif" width=220 height=60 alt="Methods"></a>
  164.  
  165.     <p>
  166.       This class has no methods.
  167.     </p>
  168.  
  169.     <hr>
  170.  
  171. <!--INCLUDESTART="JTPGNAV.TXT"-->
  172.  
  173.     
  174.     <a href="install.htm">Previous</a> 
  175.     <a href="formtool.htm">Next</a> 
  176.     <a href="classidx.htm">Index</a><br>
  177.                                  
  178. <!--INCLUDESTOP="JTPGNAV.TXT"-->
  179. <!--INCLUDESTART="JTPGIDX.TXT"-->
  180.       <center>
  181.         <font size="-2" face="Arial" color="FF0000">
  182.           <strong>
  183.             <a href="#DESCRIPTION">Description</a> |
  184.             <a href="#EXAMPLES">Examples</a> |
  185.             <a href="#CONSTRUCTORS">Constructors</a> |
  186.             <a href="#METHODS">Methods</a>
  187.           </strong>
  188.         </font>
  189.       </center>
  190. <!--INCLUDESTOP="JTPGIDX.TXT"-->
  191. <!--INCLUDESTART="JTCLSFTR.TXT"-->
  192.     <center>
  193.       <font size="-2" face="Arial" color="FF0000">
  194.         <strong>
  195.           <a href="../jtkit.htm", target="_top">Java Toolkit Page</a> |
  196.           <a href="../softwr.htm", target="_top">Software</a> |
  197.           <a href="../index.html", target="_top">Home</a><br>
  198.         </strong>
  199.       </font>
  200.     </center>
  201.  
  202.     <p></p>
  203.     <font size="-1">Evans Programming Java Toolkit HTML Document<br>
  204.       Generated March 15, 1998<br>
  205.       Revised Februrary 5, 1999<br>
  206.       Copyright 1998-1999 Evans Programming<br>
  207.       Send comments or corrections to <a href="mailto:davidLevans@megsinet.net">davidLevans@megsinet.net</a>
  208.     </font>
  209. <!--INCLUDESTOP="JTCLSFTR.TXT"-->
  210.  
  211.   </body>
  212. </html>
  213.